﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CoVuaClient
{
    class QuanCo
    {
        private string _tenQuanCo;
        private bool pheMinh;
        private string _pathImage;
        private bool _dangChon;
        public QuanCo()
        {

        }

        public string TenQuanCo
        {
            get { return _tenQuanCo; }
            set { _tenQuanCo = value; }
        }

        public bool PheMinh
        {
            get { return pheMinh; }
            set { pheMinh = value; }
        }

        public string PathImage
        {
            get { return _pathImage; }
            set { _pathImage = value; }
        }

        public bool DangChon
        {
            get { return _dangChon; }
            set { _dangChon = value; }
        }

        public virtual List<OCo> NhungOCoTheDi(BanCo banCo, OCo oHienTai , bool kiemTraChieuTuong)
        {
            return null;
        }
        public static bool KiemTraCoQuanTa(BanCo banCo, OCo oCanDen)
        {
            foreach (var oCo in banCo.DsOCo)
            {
                if (oCanDen.Cot == oCo.Cot && oCanDen.Dong == oCo.Dong)
                {
                    if (oCo.QuanCoHienTai != null)
                    {
                        return oCo.QuanCoHienTai.PheMinh;
                    }
                }
            }
            return false;
        }
        public static bool KiemTraCoQuanDich(BanCo banCo, OCo oCanDen)
        {
            foreach (var oCo in banCo.DsOCo)
            {
                if (oCanDen.Cot == oCo.Cot && oCanDen.Dong == oCo.Dong)
                {
                    if (oCo.QuanCoHienTai != null)
                    {
                        return !oCo.QuanCoHienTai.PheMinh;
                    }
                }
            }
            return false;
        }
        public virtual void ChangeState()
        {

        }
        public virtual void DaXuatQuan()
        {
        }
    }
}
